<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>商品筛选 - 社交精选</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #6366f1;
            --primary-dark: #4338ca;
            --secondary: #ec4899;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #111827;
            --text-secondary: #6b7280;
            --text-light: #9ca3af;
            --bg-light: #f9fafb;
            --bg-white: #ffffff;
            --border-light: #e5e7eb;
            --border-medium: #d1d5db;
            --radius: 10px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 55px;
            padding-bottom: 60px;
            line-height: 1.5;
        }
        
        /* 导航栏样式 */
        .navbar {
            height: 55px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            padding: 0 15px;
        }
        
        .navbar-brand {
            color: var(--primary);
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .search-container {
            position: relative;
            flex: 1;
            max-width: 400px;
            margin: 0 10px;
        }
        
        .search-input {
            width: 100%;
            background-color: var(--bg-light);
            border: 1px solid var(--border-light);
            border-radius: 25px;
            padding: 8px 15px;
            padding-left: 40px;
            font-size: 0.85rem;
            outline: none;
            transition: all 0.3s;
        }
        
        .search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-light);
            font-size: 0.9rem;
        }
        
        .search-actions {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            gap: 8px;
        }
        
        .search-action-btn {
            background: none;
            border: none;
            color: var(--text-light);
            font-size: 0.85rem;
            padding: 3px 5px;
        }
        
        .search-action-btn:hover {
            color: var(--primary);
        }
        
        .nav-actions {
            display: flex;
            gap: 15px;
            font-size: 1.1rem;
            color: var(--text-secondary);
        }
        
        /* 筛选栏 */
        .filter-bars-container {
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-bar {
            padding: 10px 15px;
            border-bottom: 1px solid var(--border-light);
            overflow-x: auto;
            scrollbar-width: none;
        }
        
        .filter-bar:last-child {
            border-bottom: none;
        }
        
        .filter-bar::-webkit-scrollbar {
            display: none;
        }
        
        .filter-section-title {
            font-size: 0.8rem;
            color: var(--text-light);
            margin-bottom: 8px;
            white-space: nowrap;
        }
        
        .filter-options {
            display: flex;
            gap: 10px;
            padding-bottom: 5px;
        }
        
        .filter-option {
            white-space: nowrap;
            font-size: 0.9rem;
            padding: 5px 12px;
            border-radius: 18px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-option.default {
            color: var(--text-secondary);
            background-color: var(--bg-light);
        }
        
        .filter-option.active {
            color: white;
            background-color: var(--primary);
            font-weight: 500;
        }
        
        .filter-option.has-count {
            position: relative;
            padding-right: 30px;
        }
        
        .filter-count {
            position: absolute;
            right: 8px;
            font-size: 0.75rem;
            opacity: 0.9;
        }
        
        .filter-dropdown {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        /* 高级筛选按钮 */
        .advanced-filter-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            width: 100%;
            padding: 10px;
            background-color: var(--bg-white);
            border: 1px dashed var(--border-medium);
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        /* 已选筛选条件 */
        .selected-filters {
            padding: 10px 15px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        
        .selected-filters-title {
            font-size: 0.85rem;
            color: var(--text-light);
            white-space: nowrap;
        }
        
        .filter-tag {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            background-color: rgba(79, 70, 229, 0.1);
            color: var(--primary);
            border-radius: 15px;
            font-size: 0.8rem;
        }
        
        .remove-filter {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background-color: rgba(79, 70, 229, 0.2);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            cursor: pointer;
        }
        
        .clear-all {
            font-size: 0.8rem;
            color: var(--text-light);
            margin-left: auto;
            cursor: pointer;
        }
        
        /* 商品列表容器 */
        .product-container {
            padding: 10px;
        }
        
        .product-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        
        /* 商品卡片基础样式 */
        .product-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
        }
        
        /* 商品图片容器 */
        .product-images {
            position: relative;
            aspect-ratio: 1/1;
            background-color: var(--bg-light);
            overflow: hidden;
        }
        
        /* 单图商品 */
        .single-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        
        /* 多图商品 */
        .multiple-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, 1fr);
            gap: 2px;
        }
        
        .multiple-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 无图商品 */
        .no-image {
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            font-size: 2rem;
        }
        
        /* 图片角标 */
        .image-badge {
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            font-size: 0.7rem;
            padding: 2px 5px;
            border-radius: 3px;
        }
        
        .tag-badge {
            position: absolute;
            top: 5px;
            left: 5px;
            background-color: var(--secondary);
            color: white;
            font-size: 0.7rem;
            padding: 2px 5px;
            border-radius: 3px;
        }
        
        /* 商品信息 */
        .product-info {
            padding: 8px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .product-title {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-primary);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 5px;
            line-height: 1.3;
        }
        
        .product-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: auto;
        }
        
        .product-price {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--secondary);
        }
        
        .product-seller {
            display: flex;
            align-items: center;
            gap: 3px;
            font-size: 0.7rem;
            color: var(--text-light);
        }
        
        .seller-avatar {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            overflow: hidden;
        }
        
        .seller-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 商品互动区 */
        .product-actions {
            display: flex;
            justify-content: space-between;
            padding: 5px 8px 8px;
            border-top: 1px solid var(--border-light);
            font-size: 0.8rem;
        }
        
        .action-like {
            color: var(--text-light);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .action-like.liked {
            color: var(--danger);
        }
        
        .action-comment {
            color: var(--text-light);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        /* 视图切换 */
        .view-toggle-container {
            padding: 10px 15px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .results-count {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        
        .view-options {
            display: flex;
            border: 1px solid var(--border-light);
            border-radius: 20px;
            overflow: hidden;
        }
        
        .view-option {
            padding: 5px 12px;
            font-size: 0.85rem;
            background-color: var(--bg-white);
            border: none;
            color: var(--text-secondary);
        }
        
        .view-option.active {
            background-color: var(--primary);
            color: white;
        }
        
        .view-option:first-child {
            border-right: 1px solid var(--border-light);
        }
        
        /* 加载更多 */
        .load-more {
            padding: 15px;
            text-align: center;
        }
        
        .load-more-btn {
            background-color: var(--bg-white);
            border: 1px solid var(--primary);
            color: var(--primary);
            padding: 8px 25px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.2s;
        }
        
        .load-more-btn:hover {
            background-color: var(--primary);
            color: white;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: var(--bg-white);
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        
        .nav-tab {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 0.65rem;
            color: var(--text-secondary);
            text-decoration: none;
        }
        
        .nav-tab i {
            font-size: 1rem;
            margin-bottom: 3px;
        }
        
        .nav-tab.active {
            color: var(--primary);
        }
        
        /* 高级筛选弹窗 */
        .filter-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            display: none;
        }
        
        .filter-modal.show {
            display: block;
        }
        
        .modal-content {
            background-color: var(--bg-white);
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            border-top-left-radius: var(--radius);
            border-top-right-radius: var(--radius);
            max-height: 85vh;
            overflow-y: auto;
            transform: translateY(100%);
            transition: transform 0.3s ease-out;
        }
        
        .filter-modal.show .modal-content {
            transform: translateY(0);
        }
        
        .modal-header {
            padding: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .modal-title {
            font-size: 1rem;
            font-weight: 600;
        }
        
        .close-modal {
            background: none;
            border: none;
            font-size: 1.2rem;
            color: var(--text-secondary);
        }
        
        .filter-group {
            padding: 15px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-group-title {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--text-primary);
            display: flex;
            justify-content: space-between;
        }
        
        .select-all {
            font-size: 0.8rem;
            color: var(--primary);
            font-weight: normal;
        }
        
        .filter-checkboxes {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .filter-checkbox {
            display: none;
        }
        
        .filter-checkbox + label {
            display: inline-block;
            padding: 6px 14px;
            border: 1px solid var(--border-medium);
            border-radius: 18px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-checkbox:checked + label {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 价格滑块 */
        .price-slider-container {
            padding: 10px 0;
        }
        
        .price-slider {
            width: 100%;
            margin: 15px 0;
        }
        
        .price-range {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        
        .price-inputs {
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }
        
        .price-input {
            flex: 1;
            position: relative;
        }
        
        .price-input input {
            width: 100%;
            padding: 8px 10px;
            padding-left: 25px;
            border: 1px solid var(--border-medium);
            border-radius: 6px;
            font-size: 0.85rem;
        }
        
        .price-input::before {
            content: '¥';
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 0.85rem;
        }
        
        /* 模态框按钮组 */
        .modal-actions {
            display: flex;
            padding: 15px;
            gap: 10px;
        }
        
        .reset-filters {
            flex: 1;
            padding: 10px;
            background-color: var(--bg-white);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius);
            font-size: 0.9rem;
        }
        
        .apply-filters {
            flex: 1;
            padding: 10px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        /* 空状态 */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 50px 20px;
            text-align: center;
            color: var(--text-light);
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: 15px;
        }
        
        .empty-text {
            font-size: 0.9rem;
            margin-bottom: 20px;
        }
        
        .empty-action {
            padding: 8px 20px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 0.9rem;
        }
        
        /* 列表视图样式 */
        .product-list.list-view {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .list-view .product-card {
            flex-direction: row;
        }
        
        .list-view .product-images {
            width: 100px;
            height: 100px;
            flex-shrink: 0;
        }
        
        .list-view .product-info {
            flex: 1;
            padding: 10px;
        }
        
        .list-view .product-title {
            -webkit-line-clamp: 3;
            font-size: 0.9rem;
        }
        
        .list-view .product-actions {
            border-top: none;
            padding: 0 10px;
            flex-direction: column;
            justify-content: center;
            gap: 10px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar fixed-top">
        <div class="container-fluid d-flex justify-content-between align-items-center">
            <span class="navbar-brand">发现好物</span>
            
            <div class="search-container">
                <i class="fas fa-search search-icon"></i>
                <input type="text" class="search-input" placeholder="搜索商品、品牌或描述...">
                <div class="search-actions">
                    <button class="search-action-btn" id="voiceSearch">
                        <i class="fas fa-microphone"></i>
                    </button>
                    <button class="search-action-btn" id="imageSearch">
                        <i class="fas fa-camera"></i>
                    </button>
                </div>
            </div>
            
            <div class="nav-actions">
                <i class="fas fa-sliders-h" id="advancedFilterToggle"></i>
            </div>
        </div>
    </nav>
    
    <!-- 筛选条件展示 -->
    <div class="selected-filters">
        <span class="selected-filters-title">已选：</span>
        <div class="filter-tag">
            <span>家居用品</span>
            <span class="remove-filter">×</span>
        </div>
        <div class="filter-tag">
            <span>价格 50-100元</span>
            <span class="remove-filter">×</span>
        </div>
        <div class="filter-tag">
            <span>好评优先</span>
            <span class="remove-filter">×</span>
        </div>
        <span class="clear-all">清除全部</span>
    </div>
    
    <!-- 快捷筛选栏组 -->
    <div class="filter-bars-container">
        <!-- 分类筛选 -->
        <div class="filter-bar">
            <div class="filter-section-title">商品分类</div>
            <div class="filter-options">
                <div class="filter-option active has-count">
                    全部
                    <span class="filter-count">248</span>
                </div>
                <div class="filter-option default has-count">
                    家居用品
                    <span class="filter-count">76</span>
                </div>
                <div class="filter-option default has-count">
                    数码电子
                    <span class="filter-count">54</span>
                </div>
                <div class="filter-option default has-count">
                    美妆护肤
                    <span class="filter-count">42</span>
                </div>
                <div class="filter-option default has-count">
                    服装鞋帽
                    <span class="filter-count">38</span>
                </div>
                <div class="filter-option default has-count">
                    食品饮料
                    <span class="filter-count">38</span>
                </div>
            </div>
        </div>
        
        <!-- 价格筛选 -->
        <div class="filter-bar">
            <div class="filter-section-title">价格范围</div>
            <div class="filter-options">
                <div class="filter-option active has-count">
                    全部
                    <span class="filter-count">248</span>
                </div>
                <div class="filter-option default has-count">
                    0-50元
                    <span class="filter-count">64</span>
                </div>
                <div class="filter-option default has-count">
                    50-100元
                    <span class="filter-count">82</span>
                </div>
                <div class="filter-option default has-count">
                    100-300元
                    <span class="filter-count">67</span>
                </div>
                <div class="filter-option default has-count">
                    300元以上
                    <span class="filter-count">35</span>
                </div>
                <div class="filter-option default">
                    自定义
                </div>
            </div>
        </div>
        
        <!-- 排序筛选 -->
        <div class="filter-bar">
            <div class="filter-section-title">排序方式</div>
            <div class="filter-options">
                <div class="filter-option active">推荐</div>
                <div class="filter-option default">最新上架</div>
                <div class="filter-option default">销量优先</div>
                <div class="filter-option default">价格从低到高</div>
                <div class="filter-option default">价格从高到低</div>
                <div class="filter-option default">好评优先</div>
            </div>
        </div>
        
        <!-- 其他快捷筛选 -->
        <div class="filter-bar">
            <div class="filter-section-title">其他条件</div>
            <div class="filter-options">
                <div class="filter-option default has-count">
                    有图片
                    <span class="filter-count">210</span>
                </div>
                <div class="filter-option default has-count">
                    官方认证
                    <span class="filter-count">156</span>
                </div>
                <div class="filter-option default has-count">
                    支持退换
                    <span class="filter-count">189</span>
                </div>
                <div class="filter-option default has-count">
                    今日上新
                    <span class="filter-count">24</span>
                </div>
                <div class="filter-option default has-count">
                    限时优惠
                    <span class="filter-count">42</span>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 视图切换和结果计数 -->
    <div class="view-toggle-container">
        <div class="results-count">找到 248 个商品</div>
        <div class="view-options">
            <button class="view-option active" id="gridView">
                <i class="fas fa-th"></i> 网格
            </button>
            <button class="view-option" id="listView">
                <i class="fas fa-list"></i> 列表
            </button>
        </div>
    </div>
    
    <!-- 高级筛选按钮 -->
    <button class="advanced-filter-btn" id="showAdvancedFilter">
        <i class="fas fa-filter"></i>
        <span>高级筛选</span>
    </button>
    
    <!-- 商品列表 -->
    <div class="product-container">
        <div class="product-grid product-list" id="productList">
            <!-- 1. 单图商品 -->
            <div class="product-card">
                <div class="product-images single-image">
                    <img src="https://picsum.photos/id/26/400/400" alt="商品图片">
                    <div class="tag-badge">热销</div>
                </div>
                <div class="product-info">
                    <div class="product-title">复古风陶瓷花瓶 家居装饰摆件 北欧简约风格</div>
                    <div class="product-meta">
                        <div class="product-price">¥89.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/64/100/100" alt="卖家头像">
                            </div>
                            <span>家居美学</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>128</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>32</span>
                    </div>
                </div>
            </div>
            
            <!-- 2. 多图商品 -->
            <div class="product-card">
                <div class="product-images multiple-images">
                    <img src="https://picsum.photos/id/96/400/400" alt="商品图片1">
                    <img src="https://picsum.photos/id/20/400/400" alt="商品图片2">
                    <img src="https://picsum.photos/id/24/400/400" alt="商品图片3">
                    <img src="https://picsum.photos/id/25/400/400" alt="商品图片4">
                    <div class="image-badge">4图</div>
                </div>
                <div class="product-info">
                    <div class="product-title">纯棉印花四件套 床上用品 多种图案可选</div>
                    <div class="product-meta">
                        <div class="product-price">¥259.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/65/100/100" alt="卖家头像">
                            </div>
                            <span>居家优选</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like liked">
                        <i class="fas fa-heart"></i>
                        <span>356</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>89</span>
                    </div>
                </div>
            </div>
            
            <!-- 3. 无图商品 -->
            <div class="product-card">
                <div class="product-images no-image">
                    <i class="fas fa-box"></i>
                </div>
                <div class="product-info">
                    <div class="product-title">定制款生日礼物 创意礼品 可刻字 免费配送</div>
                    <div class="product-meta">
                        <div class="product-price">¥129.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/66/100/100" alt="卖家头像">
                            </div>
                            <span>创意工坊</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>76</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>15</span>
                    </div>
                </div>
            </div>
            
            <!-- 4. 单图商品 -->
            <div class="product-card">
                <div class="product-images single-image">
                    <img src="https://picsum.photos/id/42/400/400" alt="商品图片">
                    <div class="tag-badge">新品</div>
                </div>
                <div class="product-info">
                    <div class="product-title">无线蓝牙耳机 主动降噪 长续航 高清通话</div>
                    <div class="product-meta">
                        <div class="product-price">¥399.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/67/100/100" alt="卖家头像">
                            </div>
                            <span>数码优选</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>512</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>124</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 加载更多 -->
    <div class="load-more">
        <button class="load-more-btn" id="loadMoreBtn">加载更多</button>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-tab">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-tab active">
            <i class="fas fa-shopping-bag"></i>
            <span>商品</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-plus-circle"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-bell"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 高级筛选弹窗 -->
    <div class="filter-modal" id="filterModal">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">高级筛选</div>
                <button class="close-modal" id="closeModal">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <!-- 价格范围 -->
            <div class="filter-group">
                <div class="filter-group-title">
                    <span>价格范围</span>
                    <span class="select-all">全选</span>
                </div>
                <div class="price-slider-container">
                    <input type="range" min="0" max="1000" value="500" class="price-slider" id="priceSlider">
                    <div class="price-range">
                        <span>¥0</span>
                        <span>¥500</span>
                        <span>¥1000+</span>
                    </div>
                    <div class="price-inputs">
                        <div class="price-input">
                            <input type="number" placeholder="最低" value="0">
                        </div>
                        <div class="price-input">
                            <input type="number" placeholder="最高" value="500">
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 商品分类 -->
            <div class="filter-group">
                <div class="filter-group-title">
                    <span>商品分类</span>
                    <span class="select-all">全选</span>
                </div>
                <div class="filter-checkboxes">
                    <input type="checkbox" id="cat1" class="filter-checkbox">
                    <label for="cat1">家居用品 (76)</label>
                    
                    <input type="checkbox" id="cat2" class="filter-checkbox">
                    <label for="cat2">数码电子 (54)</label>
                    
                    <input type="checkbox" id="cat3" class="filter-checkbox">
                    <label for="cat3">美妆护肤 (42)</label>
                    
                    <input type="checkbox" id="cat4" class="filter-checkbox">
                    <label for="cat4">服装鞋帽 (38)</label>
                    
                    <input type="checkbox" id="cat5" class="filter-checkbox">
                    <label for="cat5">食品饮料 (38)</label>
                    
                    <input type="checkbox" id="cat6" class="filter-checkbox">
                    <label for="cat6">礼品礼物 (24)</label>
                    
                    <input type="checkbox" id="cat7" class="filter-checkbox">
                    <label for="cat7">运动户外 (18)</label>
                    
                    <input type="checkbox" id="cat8" class="filter-checkbox">
                    <label for="cat8">图书音像 (16)</label>
                </div>
            </div>
            
            <!-- 商品属性 -->
            <div class="filter-group">
                <div class="filter-group-title">
                    <span>商品属性</span>
                    <span class="select-all">全选</span>
                </div>
                <div class="filter-checkboxes">
                    <input type="checkbox" id="attr1" class="filter-checkbox">
                    <label for="attr1">品牌正品</label>
                    
                    <input type="checkbox" id="attr2" class="filter-checkbox">
                    <label for="attr2">进口商品</label>
                    
                    <input type="checkbox" id="attr3" class="filter-checkbox">
                    <label for="attr3">国产精品</label>
                    
                    <input type="checkbox" id="attr4" class="filter-checkbox">
                    <label for="attr4">手工制作</label>
                    
                    <input type="checkbox" id="attr5" class="filter-checkbox">
                    <label for="attr5">定制款</label>
                </div>
            </div>
            
            <!-- 配送与服务 -->
            <div class="filter-group">
                <div class="filter-group-title">
                    <span>配送与服务</span>
                    <span class="select-all">全选</span>
                </div>
                <div class="filter-checkboxes">
                    <input type="checkbox" id="service1" class="filter-checkbox">
                    <label for="service1">次日达</label>
                    
                    <input type="checkbox" id="service2" class="filter-checkbox">
                    <label for="service2">满减优惠</label>
                    
                    <input type="checkbox" id="service3" class="filter-checkbox">
                    <label for="service3">支持退换</label>
                    
                    <input type="checkbox" id="service4" class="filter-checkbox">
                    <label for="service4">正品保障</label>
                    
                    <input type="checkbox" id="service5" class="filter-checkbox">
                    <label for="service5">免费配送</label>
                </div>
            </div>
            
            <!-- 筛选按钮组 -->
            <div class="modal-actions">
                <button class="reset-filters" id="resetFilters">重置</button>
                <button class="apply-filters" id="applyFilters">确定</button>
            </div>
        </div>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 筛选弹窗控制
        const advancedFilterToggle = document.getElementById('advancedFilterToggle');
        const showAdvancedFilter = document.getElementById('showAdvancedFilter');
        const filterModal = document.getElementById('filterModal');
        const closeModal = document.getElementById('closeModal');
        
        function openFilterModal() {
            filterModal.classList.add('show');
            document.body.style.overflow = 'hidden'; // 防止背景滚动
        }
        
        function closeFilterModal() {
            filterModal.classList.remove('show');
            document.body.style.overflow = ''; // 恢复滚动
        }
        
        advancedFilterToggle.addEventListener('click', openFilterModal);
        showAdvancedFilter.addEventListener('click', openFilterModal);
        closeModal.addEventListener('click', closeFilterModal);
        
        // 点击弹窗外部关闭
        filterModal.addEventListener('click', (e) => {
            if (e.target === filterModal) {
                closeFilterModal();
            }
        });
        
        // 筛选条件应用与重置
        const applyFilters = document.getElementById('applyFilters');
        const resetFilters = document.getElementById('resetFilters');
        const filterCheckboxes = document.querySelectorAll('.filter-checkbox');
        
        applyFilters.addEventListener('click', () => {
            applyFilters.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 应用中...';
            
            setTimeout(() => {
                closeFilterModal();
                applyFilters.textContent = '确定';
                
                // 收集选中的筛选条件
                const selectedFilters = [];
                filterCheckboxes.forEach(checkbox => {
                    if (checkbox.checked) {
                        selectedFilters.push(checkbox.nextElementSibling.textContent.split(' ')[0]);
                    }
                });
                
                if (selectedFilters.length > 0) {
                    console.log('应用高级筛选条件:', selectedFilters);
                    // 实际项目中这里会根据筛选条件更新商品列表
                }
            }, 800);
        });
        
        resetFilters.addEventListener('click', () => {
            filterCheckboxes.forEach(checkbox => {
                checkbox.checked = false;
            });
            
            // 重置价格滑块
            document.getElementById('priceSlider').value = 500;
            document.querySelectorAll('.price-input input')[0].value = 0;
            document.querySelectorAll('.price-input input')[1].value = 500;
        });
        
        // 价格滑块同步
        const priceSlider = document.getElementById('priceSlider');
        const priceInputs = document.querySelectorAll('.price-input input');
        
        priceSlider.addEventListener('input', () => {
            priceInputs[1].value = priceSlider.value;
        });
        
        // 全选功能
        const selectAllButtons = document.querySelectorAll('.select-all');
        selectAllButtons.forEach(button => {
            button.addEventListener('click', () => {
                const filterGroup = button.closest('.filter-group');
                const checkboxes = filterGroup.querySelectorAll('.filter-checkbox');
                const allChecked = Array.from(checkboxes).every(cb => cb.checked);
                
                checkboxes.forEach(cb => {
                    cb.checked = !allChecked;
                });
            });
        });
        
        // 快捷筛选选项切换
        const filterOptions = document.querySelectorAll('.filter-option');
        filterOptions.forEach(option => {
            // 跳过"全部"选项的父容器
            if (option.textContent.includes('全部') && option.classList.contains('has-count')) {
                return;
            }
            
            option.addEventListener('click', () => {
                // 获取同组的所有筛选选项
                const siblings = Array.from(option.parentElement.children);
                
                // 如果是"全部"选项，则取消其他选项的选中状态
                if (option.textContent.includes('全部')) {
                    siblings.forEach(sib => sib.classList.remove('active'));
                    siblings.forEach(sib => sib.classList.add('default'));
                    option.classList.remove('default');
                    option.classList.add('active');
                } else {
                    // 对于其他选项，只切换当前选项的状态
                    option.classList.toggle('active');
                    option.classList.toggle('default');
                    
                    // 如果点击了其他选项，取消"全部"选项的选中状态
                    const allOption = siblings.find(sib => sib.textContent.includes('全部'));
                    if (allOption && option.classList.contains('active')) {
                        allOption.classList.remove('active');
                        allOption.classList.add('default');
                    }
                }
                
                // 更新筛选标签
                updateFilterTags();
                
                // 更新结果计数
                updateResultsCount();
            });
        });
        
        // 视图切换（网格/列表）
        const gridViewBtn = document.getElementById('gridView');
        const listViewBtn = document.getElementById('listView');
        const productList = document.getElementById('productList');
        
        gridViewBtn.addEventListener('click', () => {
            productList.classList.remove('list-view');
            productList.classList.add('product-grid');
            gridViewBtn.classList.add('active');
            listViewBtn.classList.remove('active');
        });
        
        listViewBtn.addEventListener('click', () => {
            productList.classList.remove('product-grid');
            productList.classList.add('list-view');
            listViewBtn.classList.add('active');
            gridViewBtn.classList.remove('active');
        });
        
        // 移除筛选标签
        const removeFilterButtons = document.querySelectorAll('.remove-filter');
        removeFilterButtons.forEach(button => {
            button.addEventListener('click', () => {
                const tag = button.parentElement;
                tag.remove();
                
                // 如果没有筛选标签了，隐藏"已选"标题
                const filterTags = document.querySelectorAll('.filter-tag');
                if (filterTags.length === 0) {
                    document.querySelector('.selected-filters-title').style.display = 'none';
                }
                
                // 重置对应的筛选选项
                resetCorrespondingFilter(tag.textContent.trim());
            });
        });
        
        // 清除全部筛选条件
        document.querySelector('.clear-all').addEventListener('click', () => {
            // 移除所有筛选标签
            document.querySelectorAll('.filter-tag').forEach(tag => tag.remove());
            document.querySelector('.selected-filters-title').style.display = 'none';
            
            // 重置所有筛选选项
            filterOptions.forEach(option => {
                option.classList.remove('active');
                option.classList.add('default');
            });
            
            // 选中所有"全部"选项
            document.querySelectorAll('.filter-option:contains("全部")').forEach(option => {
                option.classList.remove('default');
                option.classList.add('active');
            });
            
            // 重置高级筛选
            filterCheckboxes.forEach(checkbox => {
                checkbox.checked = false;
            });
            
            // 更新结果计数
            updateResultsCount();
        });
        
        // 商品点赞功能
        const likeButtons = document.querySelectorAll('.action-like');
        likeButtons.forEach(btn => {
            btn.addEventListener('click', () => {
                btn.classList.toggle('liked');
                const icon = btn.querySelector('i');
                const countElem = btn.querySelector('span');
                let count = parseInt(countElem.textContent);
                
                if (btn.classList.contains('liked')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    count++;
                } else {
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    count--;
                }
                
                countElem.textContent = count;
            });
        });
        
        // 加载更多商品
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        loadMoreBtn.addEventListener('click', () => {
            loadMoreBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
            
            setTimeout(() => {
                // 模拟加载更多商品
                const productGrid = document.querySelector('.product-list');
                
                // 添加新商品（代码省略，与前面示例类似）
                
                loadMoreBtn.textContent = '加载更多';
            }, 1500);
        });
        
        // 辅助函数：更新筛选标签
        function updateFilterTags() {
            // 清空现有标签（保留"已选："标题）
            document.querySelectorAll('.filter-tag').forEach(tag => tag.remove());
            
            // 收集所有选中的筛选条件
            const activeFilters = Array.from(filterOptions)
                .filter(option => option.classList.contains('active') && !option.textContent.includes('全部'))
                .map(option => option.textContent.trim().split('\n')[0]);
            
            // 显示"已选："标题
            const title = document.querySelector('.selected-filters-title');
            title.style.display = activeFilters.length > 0 ? 'block' : 'none';
            
            // 添加新的筛选标签
            activeFilters.forEach(filterText => {
                const tag = document.createElement('div');
                tag.className = 'filter-tag';
                tag.innerHTML = `
                    <span>${filterText}</span>
                    <span class="remove-filter">×</span>
                `;
                title.after(tag);
                
                // 为新标签添加删除事件
                tag.querySelector('.remove-filter').addEventListener('click', () => {
                    tag.remove();
                    resetCorrespondingFilter(filterText);
                    
                    // 如果没有筛选标签了，隐藏"已选"标题
                    if (document.querySelectorAll('.filter-tag').length === 0) {
                        title.style.display = 'none';
                    }
                });
            });
        }
        
        // 辅助函数：重置对应的筛选选项
        function resetCorrespondingFilter(filterText) {
            // 找到对应的筛选选项并重置
            const correspondingOption = Array.from(filterOptions).find(
                option => option.textContent.trim().includes(filterText)
            );
            
            if (correspondingOption) {
                correspondingOption.classList.remove('active');
                correspondingOption.classList.add('default');
                
                // 找到同组的"全部"选项并激活
                const siblings = Array.from(correspondingOption.parentElement.children);
                const allOption = siblings.find(sib => sib.textContent.includes('全部'));
                
                if (allOption) {
                    // 检查同组是否还有其他激活的选项
                    const hasActiveOptions = siblings.some(
                        sib => sib !== allOption && sib.classList.contains('active')
                    );
                    
                    if (!hasActiveOptions) {
                        allOption.classList.remove('default');
                        allOption.classList.add('active');
                    }
                }
            }
            
            // 更新结果计数
            updateResultsCount();
        }
        
        // 辅助函数：更新结果计数
        function updateResultsCount() {
            // 计算活跃筛选条件的数量
            const activeFiltersCount = document.querySelectorAll('.filter-option.active:not(:contains("全部"))').length;
            
            // 模拟结果计数变化（实际项目中应根据真实筛选结果计算）
            let baseCount = 248;
            let filteredCount = Math.max(10, baseCount - (activeFiltersCount * 30));
            
            document.querySelector('.results-count').textContent = `找到 ${filteredCount} 个商品`;
        }
        
        // 扩展String.prototype以支持:contains选择器
        (function($) {
            $.fn.contains = function(text) {
                var args = arguments;
                return this.filter(function() {
                    return (new RegExp(text, "gi")).test($(this).text());
                });
            };
        })(jQuery);
    </script>
</body>
</html>
    
